import Vue from 'vue';
import Router from 'vue-router';

Vue.use(Router);
/*路由配置。vue是单页面的*/
export default new Router({
    routes: [
        {
            path: '/',
            redirect: '/dashboard'
        },
        {
            path: '/',
            component: () => import(/* webpackChunkName: "home" */ '../components/common/Home.vue'),
            meta: {title: '自述文件'},
            children: [
                {
                    path: '/dashboard',
                    component: () => import( '../components/page/FirstPage.vue'),
                    meta: {title: '系统首页'}
                }, {
                    path: '/check',
                    component: () => import( '../components/page/Check.vue'),
                    meta: {title: '考勤打卡'}
                }, {
                    path: '/publish',
                    component: () => import( '../components/page/Publish.vue'),
                    meta: {title: '通知发布'}
                }, {
                    path: '/record',
                    component: () => import( '../components/page/AttRecord.vue'),
                    meta: {title: '考勤记录'}
                }, {
                    path: '/article',
                    name: 'article',
                    component: () => import(/* webpackChunkName: "enterprise" */ '../components/page/Article.vue'),
                    meta: {title: '通知要闻'}
                }, {
                    path: '/selRecord',
                    component: () => import( '../components/page/SelRecord.vue'),
                    meta: {title: '出勤情况查询'}
                }, {
                    path: '/recordCharts',
                    component: () => import( '../components/page/RecordCharts.vue'),
                    meta: {title: '出勤统计'}
                },
                {
                    path: '/roleManage',
                    component: () => import( '../components/page/RoleManage.vue'),
                    meta: {title: '角色管理'}
                }, {
                    path: '/userManage',
                    component: () => import( '../components/page/UserManage.vue'),
                    meta: {title: '用户管理'}
                }, {
                    path: '/userAdd',
                    component: () => import( '../components/page/UserAdd.vue'),
                    meta: {title: '添加用户'}
                }, {
                    path: '/setPwd',
                    component: () => import( '../components/page/SetPwd.vue'),
                    meta: {title: '修改密码'}
                }, {
                    path: '/control',
                    component: () => import( '../components/page/ControllManage.vue'),
                    meta: {title: '考勤监控'}
                },
                {
                    // 国际化组件
                    path: '/i18n',
                    component: () => import(/* webpackChunkName: "i18n" */ '../components/page/I18n.vue'),
                    meta: {title: '国际化'}
                },
                {
                    // 权限页面
                    path: '/permission',
                    component: () => import('../components/page/Permission.vue'),
                    meta: {title: '权限测试', permission: true}
                }, {
                    // 排班
                    path: '/order',
                    component: () => import( '../components/page/Order.vue'),
                    meta: {title: '排班'}
                },
                {
                    path: '/404',
                    component: () => import(/* webpackChunkName: "404" */ '../components/page/404.vue'),
                    meta: {title: '404'}
                },
                {
                    path: '/403',
                    component: () => import(/* webpackChunkName: "403" */ '../components/page/403.vue'),
                    meta: {title: '403'}
                },
            ]
        },
        {
            path: '/login',
            component: () => import(/* webpackChunkName: "login" */ '../components/page/Login.vue'),
            meta: {title: '登录'}
        },
        {
            path: '*',
            redirect: '/404'
        }
    ]
});
